package com.jic.member.job;

import com.jic.common.base.vo.RestResult;
import com.jic.member.service.TLabelService;
import com.jic.member.service.TUserGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wj
 * @Description:
 * @date 2020-06-18 13:38
 */
@RestController
@Slf4j
@RequestMapping("/labelTask")
@Api(tags = " [标签-task]-PC")
public class LabelTask {
    @Autowired
    private TLabelService service;
    @Autowired
    private TUserGroupService tUserGroupService;

    /**
     * 通过性别定时调用会员数据
     *
     * @return author 建投数据科技(山东)有限公司
     * @date 2020-3-11 20:54:04
     */
    @ApiOperation(value = "通过性别定时调用会员数据")
    @GetMapping("/getMemberInfoBySex")
    @ResponseBody
    public RestResult<Boolean> getMemberInfoBySex() throws Throwable {
        return service.getMemberInfoBySex();
    }

    /**
     * 通过会员等级定时调用会员数据
     *
     * @return author 建投数据科技(山东)有限公司
     * @date 2020-3-11 20:54:04
     */
    @ApiOperation(value = "通过会员等级定时调用会员数据")
    @GetMapping("/getMemberInfoByMemberGrade")
    @ResponseBody
    public RestResult<Boolean> getMemberInfoByMemberGrade() throws Throwable {
        return service.getMemberInfoByMemberGrade();
    }

    /**
     * 通过会员类型定时调用会员数据
     *
     * @return author 建投数据科技(山东)有限公司
     * @date 2020-3-11 20:54:04
     */
    @ApiOperation(value = "通过会员类型定时调用会员数据")
    @GetMapping("/getMemberInfoByMemberType")
    @ResponseBody
    public RestResult<Boolean> getMemberInfoByMemberType() throws Throwable {
        return service.getMemberInfoByMemberType();
    }


    /**
     * 通过年龄定时调用会员数据
     *
     * @return author 建投数据科技(山东)有限公司
     * @date 2020-3-11 20:54:04
     */
    @ApiOperation(value = "通过年龄定时调用会员数据")
    @GetMapping("/getMemberInfoByAge")
    @ResponseBody
    public RestResult<Boolean> getMemberInfoByAge() throws Throwable {
        return service.getMemberInfoByAge();
    }


    /**
     * 通过自定义标签调用会员数据
     *
     * @return author 建投数据科技(山东)有限公司
     * @date 2020-3-11 20:54:04
     */
    @ApiOperation(value = "通过自定义标签调用会员数据")
    @GetMapping("/getMemberInfoByCustomLabel")
    @ResponseBody
    public RestResult<Boolean> getMemberInfoByCustomLabel() throws Throwable {
        return service.getMemberInfoByCustomLabel();
    }

    @GetMapping("/timeToRefreshGrouping")
    @ApiOperation(value = "定时刷新分组")
    @ResponseBody
    public RestResult<String> timeToRefreshGrouping() {
        return tUserGroupService.timeToRefreshGrouping();
    }
}
